package com.google.ads;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.google.ads.b.r;
import com.google.ads.b.z;
import com.google.ads.util.AdUtil;
import com.google.ads.util.ad;

public class h extends RelativeLayout
  implements a
{
  private r a;

  public h(Activity paramActivity, g paramg, String paramString)
  {
    super(paramActivity.getApplicationContext());
    try
    {
      a(paramActivity, paramg, null);
      b(paramActivity, paramg, null);
      a(paramActivity, paramg, paramString);
      return;
    }
    catch (com.google.ads.b.i locali)
    {
      a(paramActivity, locali.b("Could not initialize AdView"), paramg, null);
      locali.a("Could not initialize AdView");
    }
  }

  private int a(Context paramContext, int paramInt)
  {
    return (int)TypedValue.applyDimension(1, paramInt, paramContext.getResources().getDisplayMetrics());
  }

  private void a(Activity paramActivity, g paramg, String paramString)
  {
    FrameLayout localFrameLayout = new FrameLayout(paramActivity);
    localFrameLayout.setFocusable(false);
    this.a = new r(this, paramActivity, paramg, paramString, localFrameLayout, false);
    setGravity(17);
    try
    {
      ViewGroup localViewGroup = z.a(paramActivity, this.a);
      if (localViewGroup != null)
      {
        localViewGroup.addView(localFrameLayout, -2, -2);
        addView(localViewGroup, -2, -2);
        return;
      }
      addView(localFrameLayout, -2, -2);
      return;
    }
    catch (VerifyError localVerifyError)
    {
      com.google.ads.util.d.a("Gestures disabled: Not supported on this version of Android.", localVerifyError);
      addView(localFrameLayout, -2, -2);
    }
  }

  private void a(Context paramContext, String paramString, g paramg, AttributeSet paramAttributeSet)
  {
    com.google.ads.util.d.b(paramString);
    a(paramContext, paramString, -65536, paramg, paramAttributeSet);
  }

  private void a(g[] paramArrayOfg)
  {
    g[] arrayOfg = new g[paramArrayOfg.length];
    for (int i = 0; i < paramArrayOfg.length; i++)
      arrayOfg[i] = g.a(paramArrayOfg[i], getContext());
    this.a.g().l.a(arrayOfg);
  }

  private boolean a(Context paramContext, g paramg, AttributeSet paramAttributeSet)
  {
    if (!AdUtil.c(paramContext))
    {
      a(paramContext, "You must have AdActivity declared in AndroidManifest.xml with configChanges.", paramg, paramAttributeSet);
      return false;
    }
    return true;
  }

  private boolean b(Context paramContext, g paramg, AttributeSet paramAttributeSet)
  {
    if (!AdUtil.b(paramContext))
    {
      a(paramContext, "You must have INTERNET and ACCESS_NETWORK_STATE permissions in AndroidManifest.xml.", paramg, paramAttributeSet);
      return false;
    }
    return true;
  }

  void a(Context paramContext, String paramString, int paramInt, g paramg, AttributeSet paramAttributeSet)
  {
    if (paramg == null)
      paramg = g.b;
    g localg = g.a(paramg, paramContext.getApplicationContext());
    TextView localTextView;
    LinearLayout localLinearLayout1;
    if (getChildCount() == 0)
    {
      if (paramAttributeSet != null)
        break label176;
      localTextView = new TextView(paramContext);
      localTextView.setGravity(17);
      localTextView.setText(paramString);
      localTextView.setTextColor(paramInt);
      localTextView.setBackgroundColor(-16777216);
      if (paramAttributeSet != null)
        break label191;
      localLinearLayout1 = new LinearLayout(paramContext);
      label84: localLinearLayout1.setGravity(17);
      if (paramAttributeSet != null)
        break label206;
    }
    label176: label191: label206: for (LinearLayout localLinearLayout2 = new LinearLayout(paramContext); ; localLinearLayout2 = new LinearLayout(paramContext, paramAttributeSet))
    {
      localLinearLayout2.setGravity(17);
      localLinearLayout2.setBackgroundColor(paramInt);
      int i = a(paramContext, localg.a());
      int j = a(paramContext, localg.b());
      localLinearLayout1.addView(localTextView, i - 2, j - 2);
      localLinearLayout2.addView(localLinearLayout1);
      addView(localLinearLayout2, i, j);
      return;
      localTextView = new TextView(paramContext, paramAttributeSet);
      break;
      localLinearLayout1 = new LinearLayout(paramContext, paramAttributeSet);
      break label84;
    }
  }

  public void a(d paramd)
  {
    if (this.a != null)
    {
      if (a())
        this.a.d();
      this.a.a(paramd);
    }
  }

  public boolean a()
  {
    if (this.a == null)
      return false;
    return this.a.q();
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    com.google.ads.b.c localc = this.a.j();
    if (localc != null)
      localc.setVisibility(0);
    super.onMeasure(paramInt1, paramInt2);
  }

  public void setAdListener(c paramc)
  {
    this.a.g().m.a(paramc);
  }

  protected void setAppEventListener(i parami)
  {
    this.a.g().n.a(parami);
  }

  protected void setSupportedAdSizes(g[] paramArrayOfg)
  {
    if (this.a.g().l.a() == null)
    {
      com.google.ads.util.d.b("Error: Tried to set supported ad sizes on a single-size AdView.");
      return;
    }
    a(paramArrayOfg);
  }
}

/* Location:           D:\Studium\Bachelorarbeit\BA Marcus Wobig\BA\BA\Decompiler\PicturePassword APK\Programm\PicturePassword_dex2jar.jar
 * Qualified Name:     com.google.ads.h
 * JD-Core Version:    0.6.2
 */